A video delivery service may delivery videos to users of the service. In one example, a video delivery service may offer a library of videos that the users can request on-demand. In some cases, the delivery of the videos may be supported by dynamically inserting advertisements (ads) into the videos while they are being delivered. The advertisements may be inserted in ad slots that are designated at certain times within the video.
The video delivery service may not be the original content owner for some of the videos that are delivered. In this case, the video delivery service may receive a video file of the video, which may be for a television show. The video file may include the entire content of the show in an uninterrupted fashion. That is, there are no ad slots inserted within the show in the video file. When the video delivery service inserts ad slots into the video, this may misalign the speech of the video with the captions for the video. For example, a company different from the content source or the video delivery service may provide a caption file for the video. The captions in the caption file may follow the speech of the video in its original format (e.g., without ad slots inserted). When the video delivery service inserts ad slots into the video, the captions may become misaligned. Typically, the video delivery service must manually align the captions with the speech of the video. This may be an inefficient process and also take a long time, especially when the video delivery service includes many videos in the library.